

#pragma once
#include <fstream>
#include <stdint.h>
#include "windows.h"

namespace FlameEngine
{
	enum LogMsgLevel
	{
		lml_error = 0,
		lml_exception,
		lml_info,
		lml_all,
	};
	
	/**
	*\brife A log class
	*
	*Log class saves message to file log.txt under current dictionary,it also
	*send message to VS ouput windows in debug mode.
	*Use LogMsgLevel enum to control how much message you want to output.
	*Message filter can be a user defined value to control what type of 
	*messsages should be ouput.
	*This class is not thread safe.
	*/
	class Log
	{
	public:
		static void WriteLine(char* msg,LogMsgLevel msgLvl=lml_all,uint32_t channel=0);

		//Set all filter state
		//e.g:animationSystem = 0x01;loadingThread = 0x02;
		//SetMsgFilter(animationSystem | loadingThread);
		static void SetMsgFilter(uint32_t filterMask);

		//Get filter state
		static uint32_t GetMsgFilter();

		//Set filter state for a single channel
		//e.g: animationSystem = 0x01;EnableChannel(animaitonSystem,true);
		static void EnableChannel(uint32_t channel,bool enable);

		static void SetOutputLevel(LogMsgLevel levle);

	private:
		static std::ofstream m_fstream;
		static LogMsgLevel m_logLevel;
		static uint32_t m_msgFilter;
	};


}